<html>
<head><meta charset="utf-8"><title>or patterns · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html">or patterns</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229387253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229387253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229387253">(Mar 08 2021 at 22:24)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="198054">@mark-i-m</span> -- I want to circle up on 'or patterns" for the 2021 Edition</p>



<a name="229387270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229387270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229387270">(Mar 08 2021 at 22:24)</a>:</h4>
<p>Have you thought at all about migration?</p>



<a name="229387281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229387281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229387281">(Mar 08 2021 at 22:24)</a>:</h4>
<p>Have we done crater runs?</p>



<a name="229419758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229419758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229419758">(Mar 09 2021 at 04:21)</a>:</h4>
<p>Hey! I haven't really thought about migration yet, but my initial thoughts are that we would only need migration for macros, right? And there, the main recommendation would be that if it doesn't compile use :pat2018 instead of :pat, I think.</p>



<a name="229419826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229419826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229419826">(Mar 09 2021 at 04:22)</a>:</h4>
<p>I don't think there is any breakage, but the migration hasn't been implemented, so there haven't been any crater runs yet, I think</p>



<a name="229479042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229479042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229479042">(Mar 09 2021 at 13:50)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> that sounds right to me. It would be good, I think, for us to do a crater run with what happens if we change the default to <code>pat2021</code>. it may be that we don't need any automated migration and we can get away with some "compatibility notes" in the edition migration guide</p>



<a name="229479119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229479119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229479119">(Mar 09 2021 at 13:50)</a>:</h4>
<p>That is my suspicion, in fact.</p>



<a name="229479128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229479128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229479128">(Mar 09 2021 at 13:50)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> I believe you felt similarly?</p>



<a name="229479157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229479157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229479157">(Mar 09 2021 at 13:50)</a>:</h4>
<p>But i'd feel better if we did a crater run to verify that</p>



<a name="229518028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229518028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229518028">(Mar 09 2021 at 17:34)</a>:</h4>
<p>I thought we did do a crater run, originally, and that's what motivated us to add the separate pattern types.</p>



<a name="229518087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229518087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229518087">(Mar 09 2021 at 17:34)</a>:</h4>
<p>Changing the default did break.</p>



<a name="229518253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229518253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229518253">(Mar 09 2021 at 17:35)</a>:</h4>
<p>But yes, I do think that we don't need a complicated migration here. It works in so many cases that for the most part what people will want is to just migrate to the new edition's version of pat.</p>



<a name="229518490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229518490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229518490">(Mar 09 2021 at 17:36)</a>:</h4>
<p>The crater run turned up a small but non-zero number of crates broken by changing the default. Too many to consider changing it without an edition boundary, but not so many that a migration seems critical.</p>



<a name="229535967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229535967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229535967">(Mar 09 2021 at 19:17)</a>:</h4>
<p>Yep, that's correct. We ran a couple of crater runs early on: <a href="https://github.com/rust-lang/rust/pull/78935#issuecomment-735050394">https://github.com/rust-lang/rust/pull/78935#issuecomment-735050394</a> and <a href="https://github.com/rust-lang/rust/pull/78935#issuecomment-740696077">https://github.com/rust-lang/rust/pull/78935#issuecomment-740696077</a></p>



<a name="229536244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229536244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229536244">(Mar 09 2021 at 19:19)</a>:</h4>
<p>The first one just changed :pat to include or-patterns while the second tried to use a fallback plan. In both cases, there was too much complex breakage -- not just syntax errors, but also type errors, borrow check errors, etc... That's why we implemented the :pat2018/21 scheme.</p>



<a name="229536303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229536303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229536303">(Mar 09 2021 at 19:19)</a>:</h4>
<p>(Sorry, I thought you meant crater runs of a migration scheme)</p>



<a name="229578686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229578686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229578686">(Mar 09 2021 at 23:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/229518490">said</a>:</p>
<blockquote>
<p>The crater run turned up a small but non-zero number of crates broken by changing the default. Too many to consider changing it without an edition boundary, but not so many that a migration seems critical.</p>
</blockquote>
<p>what is that number? :) I guess I can extract for myself</p>



<a name="229583128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/229583128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#229583128">(Mar 10 2021 at 00:46)</a>:</h4>
<p>Looks like something in the vinicity of tens of root regressions.</p>



<a name="231069506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231069506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231069506">(Mar 19 2021 at 18:30)</a>:</h4>
<p>Additionally, the breakage was non-trivial: there errors didn't just manifest as syntax errors but also as type mismatches and borrow checker errors sometimes.</p>



<a name="231133873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231133873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231133873">(Mar 20 2021 at 09:08)</a>:</h4>
<p>We discussed this in the 2021 edition meeting and we had two conclusions:</p>
<ul>
<li>First, <span class="user-mention" data-user-id="198054">@mark-i-m</span>, can we rename the pattern matcher to <code>pat2015</code> and not <code>pat2018</code>? The convention we've settled on is to name things after the edition where they were <em>first introduced</em>.</li>
<li>Second, given that, we can go ahead and include <code>pat2015</code> matcher (and the change to <code>pat2021</code> matcher in Rust 2021) in the stabilization. (Before we were concerned because  if we named it <code>pat2018</code> and then it slipped to not have the switch until after Rust 2021, that would be unfortunate, but that's no longer a concern.) This could be a separate PR or added to the existing one. Sorry for the confusion.</li>
<li>Third, we'd like to try and do a useful migration, I filed <a href="https://github.com/rust-lang/rust/issues/83318">#83318</a> about it and I plan to add some quick mentoring instructions.</li>
</ul>



<a name="231133886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231133886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231133886">(Mar 20 2021 at 09:09)</a>:</h4>
<p>It's ok <span class="user-mention" data-user-id="198054">@mark-i-m</span> if you don't want to work on <a href="https://github.com/rust-lang/rust/issues/83318">#83318</a>, though if you do that's awesome. Otherwise I think we'll do a call for contribution.</p>



<a name="231351757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231351757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231351757">(Mar 22 2021 at 17:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  Sure I can open a PR to rename :pat2018 -&gt; 2015 and another PR to stabilize it. One question: are we stabilizing only :pat2015 (i.e. not :pat2021 yet)? I suppose that would make the most sense since the edition is not stabilized yet.</p>
<p>I don't think I will have time to work on a lint, but I'm happy to help review a PR from someone else (and it looks like someone else has already claimed the issue too!)</p>



<a name="231353752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231353752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231353752">(Mar 22 2021 at 17:43)</a>:</h4>
<p>Created <a href="https://github.com/rust-lang/rust/pull/83384">https://github.com/rust-lang/rust/pull/83384</a> to do the renaming</p>



<a name="231365055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231365055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231365055">(Mar 22 2021 at 18:56)</a>:</h4>
<p>Also opened <a href="https://github.com/rust-lang/rust/pull/83386">https://github.com/rust-lang/rust/pull/83386</a></p>



<a name="231370505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231370505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231370505">(Mar 22 2021 at 19:28)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> was asking why we chose <code>pat2015</code> and <code>pat2021</code> as the names -- as opposed to, say, <code>pat_atom</code> or <code>pat_no_or</code> for <code>pat2015</code> (and no name for <code>pat2021</code>)</p>



<a name="231370666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231370666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231370666">(Mar 22 2021 at 19:29)</a>:</h4>
<p>I don't know if we ever wrote up the bikeshed and reasons behind it?</p>



<a name="231370714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231370714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231370714">(Mar 22 2021 at 19:29)</a>:</h4>
<p>thanks <span class="user-mention" data-user-id="198054">@mark-i-m</span> !</p>



<a name="231371184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231371184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231371184">(Mar 22 2021 at 19:31)</a>:</h4>
<p>I don't think we ever wrote up the rationale, no. I think the primary rationale was that most people will never need to use either of those, and will instead use :pat. The other matchers will primarily come into play when dealing with edition compatibility issues, in which case it's helpful to have a clear reminder of which one goes with which side of the edition.</p>



<a name="231371232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231371232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231371232">(Mar 22 2021 at 19:31)</a>:</h4>
<p>In particular, people expressed the concern of trying to remember which one :pat translated to.</p>



<a name="231371935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231371935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231371935">(Mar 22 2021 at 19:36)</a>:</h4>
<p>btw, i just noticed that <code>($x:pat | ..)</code> is currently accepted in --edition=2021. it should probably give an error like <code>| not allowed after pat fragments</code>, just like we do for <code>($x:expr + 1)</code></p>



<a name="231372587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231372587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231372587">(Mar 22 2021 at 19:41)</a>:</h4>
<p>that actually might be easy to do as part of implementing the migration</p>



<a name="231372606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231372606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231372606">(Mar 22 2021 at 19:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/231371184">said</a>:</p>
<blockquote>
<p>I don't think we ever wrote up the rationale, no. I think the primary rationale was that most people will never need to use either of those, and will instead use :pat. The other matchers will primarily come into play when dealing with edition compatibility issues, in which case it's helpful to have a clear reminder of which one goes with which side of the edition.</p>
</blockquote>
<p>I'm not sure if this is 100% true</p>



<a name="231372660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231372660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231372660">(Mar 22 2021 at 19:41)</a>:</h4>
<p>e.g., if you were writing a macro to accept closure syntax, you might do <code>| $x:pat_atom |</code></p>



<a name="231372732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231372732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231372732">(Mar 22 2021 at 19:42)</a>:</h4>
<p>(and many of the regressions had this shape)</p>



<a name="231387181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231387181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231387181">(Mar 22 2021 at 21:23)</a>:</h4>
<p>playing around now with that error/lint for a <code>|</code> after <code>:pat</code>. and i'm wondering if we could just make the behaviour of <code>:pat</code> depend on whether there's a <code>|</code> afterwards or not</p>



<a name="231387185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231387185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231387185">(Mar 22 2021 at 21:23)</a>:</h4>
<p>such that<code>| $x:pat |</code> will not match <code>|</code>s in the pattern, but <code>$x:pat =</code> will.</p>



<a name="231387435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231387435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231387435">(Mar 22 2021 at 21:25)</a>:</h4>
<p>then we don't need any edition change/lint/migration. I wonder if there's anything that would still break</p>



<a name="231389073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231389073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231389073">(Mar 22 2021 at 21:40)</a>:</h4>
<p>That seems really fiddly to me. Especially if there are other macros and other matchers involved.</p>



<a name="231389590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231389590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231389590">(Mar 22 2021 at 21:45)</a>:</h4>
<p>is it? the result is pretty simple: if you write a <code>|</code> after your <code>pat</code>, parsing the <code>pat</code> effectively just stops at <code>|</code>, exactly like you wrote/expect. otherwise it does not.</p>



<a name="231389726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231389726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231389726">(Mar 22 2021 at 21:46)</a>:</h4>
<p><code>$x:pat =</code>: "give me the <code>pat</code> before the <code>=</code>"</p>
<p><code>$x:pat |</code>: "give me the <code>pat</code> before the <code>|</code>"</p>



<a name="231390509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231390509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231390509">(Mar 22 2021 at 21:52)</a>:</h4>
<p>It would have to handle repetition too, like <code>$( $x:pat )|+</code> or <code>$x:pat $( | )?</code></p>



<a name="231390561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231390561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231390561">(Mar 22 2021 at 21:52)</a>:</h4>
<p>which might be fine, but more complicated</p>



<a name="231390825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231390825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231390825">(Mar 22 2021 at 21:55)</a>:</h4>
<p>yeah, but we already handle that anyway for the 'may not be followed by' lint.</p>



<a name="231393508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231393508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231393508">(Mar 22 2021 at 22:19)</a>:</h4>
<p>For the example of <code>| $x:pat_atom |</code> for closure syntax, what about the case where you want a pattern not containing a <code>|</code>, but nested patterns can contain <code>|</code> (for example <code>(pat1 | pat2,)</code>)? I would assume from the name that <code>:pat2015</code> does not permit <code>|</code> anywhere in the term</p>



<a name="231393612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231393612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231393612">(Mar 22 2021 at 22:20)</a>:</h4>
<p>(actually it looks like <span class="user-mention silent" data-user-id="310399">Mara</span> 's proposal solves that issue, with just <code>$x:pat</code>)</p>



<a name="231395022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231395022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231395022">(Mar 22 2021 at 22:34)</a>:</h4>
<p>I suspect it <em>could</em> be made to work; I'm not doubtful that it could be done.</p>



<a name="231395118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231395118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231395118">(Mar 22 2021 at 22:35)</a>:</h4>
<p>My bigger concern is that this kind of "context-dependent" matcher seems more error-prone to work with.</p>



<a name="231395762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231395762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231395762">(Mar 22 2021 at 22:42)</a>:</h4>
<p>its contextdependendness is pretty much just an implementation detail then. effectively it just means <code>:pat</code> is no longer greedy w.r.t. to <code>|</code>, which seems like a straight forward concept</p>



<a name="231396585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231396585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231396585">(Mar 22 2021 at 22:50)</a>:</h4>
<p>does that non-greediness also fall through on macro rules?</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">is_pat</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="cp">$x</span>:<span class="nc">pat</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="cp">$($x</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="231396794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231396794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231396794">(Mar 22 2021 at 22:52)</a>:</h4>
<p>I'm not sure that that is an example of greedy matching; it would have to match all <code>|</code> in that example but there's not much else it could do</p>



<a name="231396849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231396849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231396849">(Mar 22 2021 at 22:52)</a>:</h4>
<p><code>is_pat!(0 | 1)</code> is currently <code>false</code></p>



<a name="231396896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231396896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231396896">(Mar 22 2021 at 22:53)</a>:</h4>
<p>oh I see, you want something that has that exact behavior</p>



<a name="231396964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231396964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231396964">(Mar 22 2021 at 22:54)</a>:</h4>
<p>I don't necessarily want to make that, per se, but it's an example that might be affected by the proposal</p>



<a name="231397031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397031">(Mar 22 2021 at 22:54)</a>:</h4>
<p>ah yes. that would be different. interesting</p>



<a name="231397036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397036">(Mar 22 2021 at 22:54)</a>:</h4>
<p>I mean, we would have to have some alternative for the edition migration</p>



<a name="231397143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397143">(Mar 22 2021 at 22:55)</a>:</h4>
<p>I think it makes sense to have a separate syntax class for <code>pat_atom</code> since it is actually a separate nonterminal in the CFG</p>



<a name="231397249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397249">(Mar 22 2021 at 22:56)</a>:</h4>
<p>although having <code>$x:pat |</code> automatically act like <code>$x:pat_atom |</code> (possibly even as a desugaring) also sounds convenient</p>



<a name="231397479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397479">(Mar 22 2021 at 22:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="138448">cuviper</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/231396964">said</a>:</p>
<blockquote>
<p>I don't necessarily want to make that, per se, but it's an example that might be affected by the proposal</p>
</blockquote>
<p>It's also a good example of why we cannot have a <em>full</em> migration via rustfix, because we can't in general know if people's code depends on <code>:pat</code> not matching <code>|</code> patterns.</p>



<a name="231397497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397497">(Mar 22 2021 at 22:59)</a>:</h4>
<p>Any migration we do via rustfix will always be best-effort.</p>



<a name="231397606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397606">(Mar 22 2021 at 23:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/231397249">said</a>:</p>
<blockquote>
<p>although having <code>$x:pat |</code> automatically act like <code>$x:pat_atom |</code> (possibly even as a desugaring) also sounds convenient</p>
</blockquote>
<p>We could provide an error with rustfix for that. "You're trying to match a pattern followed by a <code>|</code>, but patterns can match <code>|</code>; try using <code>pat2015</code>".</p>



<a name="231397699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231397699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231397699">(Mar 22 2021 at 23:00)</a>:</h4>
<p>If the <code>pat_atom</code> matcher exists this can be mostly handled, although assuming that <code>((x | y),)</code> matches <code>pat_atom</code> in 2021 then that would cause an incompatibility anyway</p>



<a name="231398137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231398137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231398137">(Mar 22 2021 at 23:04)</a>:</h4>
<p>But I don't think this level of compatibility is worth it for macros in the 2021 edition; surely we want people to just accept that <code>|</code> is a part of pattern syntax rather than carving out a subset that omits <code>|</code> even inside parentheses</p>



<a name="231398182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231398182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231398182">(Mar 22 2021 at 23:05)</a>:</h4>
<p>If someone really needs this they can still write the macro in a crate in 2018 edition</p>



<a name="231398245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231398245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231398245">(Mar 22 2021 at 23:05)</a>:</h4>
<p>(or can they? Do 2018 macros use 2021 macro matchers when used on 2021 code?)</p>



<a name="231398954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231398954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231398954">(Mar 22 2021 at 23:13)</a>:</h4>
<p>it should use 2018 matchers if it was defined in a 2021 crate, even when used in a 2021 crate. but i'm not sure if we actually have a test for that.</p>



<a name="231400038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231400038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231400038">(Mar 22 2021 at 23:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="310399">Mara</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/231398954">said</a>:</p>
<blockquote>
<p>it should use 2018 matchers if it was defined in a 2021 crate,</p>
</blockquote>
<p>is that a typo? the matcher corresponds to the definition crate, right?</p>



<a name="231401186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231401186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231401186">(Mar 22 2021 at 23:37)</a>:</h4>
<p>That seems like it could be problematic in general, for example it would be weird for a 2015 macro <code>id!($x:expr) = $x</code> to reject something like <code>id!({ let x = y?; z })</code> in a 2018 crate since the inner code is still considered as 2018 code, right?</p>



<a name="231401325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231401325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231401325">(Mar 22 2021 at 23:39)</a>:</h4>
<p>that is, if we interpret the matcher as <code>expr2015</code> then we would have to reject all productions not present in 2015, such as postfix <code>?</code></p>



<a name="231401642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231401642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231401642">(Mar 22 2021 at 23:42)</a>:</h4>
<p>how deep do you take that? right now it seems  <em>nested</em> or-patterns are accepted in the old edition, e.g. <code>is_pat!(Some(0 | 1))</code> is <code>true</code>, or even just <code>is_pat!((0 | 1))</code></p>



<a name="231405140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231405140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231405140">(Mar 23 2021 at 00:23)</a>:</h4>
<p>Personally, I think that there should be <code>pat</code> and <code>pat_atom</code> (modulo bikeshedding), and both should accept or-patterns inside parentheses; <code>pat</code> in 2018 macros should match <code>pat_atom</code> in 2021 crates</p>



<a name="231437125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231437125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231437125">(Mar 23 2021 at 08:39)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> oh yeah, that's a typo. should be "if it was defined in a 2018 crate, even when used in a 2021 crate"</p>



<a name="231496239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496239">(Mar 23 2021 at 16:04)</a>:</h4>
<p>I'd rather not create a new kind of context dependent matcher</p>



<a name="231496258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496258">(Mar 23 2021 at 16:04)</a>:</h4>
<p>I think that adding <code>pat_atom</code> is a better idea</p>



<a name="231496306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496306">(Mar 23 2021 at 16:04)</a>:</h4>
<p>and making it an error for <code>|</code> to be in the follow set of <code>pat</code></p>



<a name="231496374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496374">(Mar 23 2021 at 16:05)</a>:</h4>
<p>I would prefer (as a user) to be explicit about this</p>



<a name="231496434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496434">(Mar 23 2021 at 16:05)</a>:</h4>
<p>also I think it's the opposite direction of how fragments ought to go</p>



<a name="231496453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231496453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231496453">(Mar 23 2021 at 16:05)</a>:</h4>
<p>which is probably to be more blindly greedy so they are more future proof :)</p>



<a name="231512768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231512768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231512768">(Mar 23 2021 at 17:45)</a>:</h4>
<p>sounds good</p>



<a name="231518565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231518565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231518565">(Mar 23 2021 at 18:21)</a>:</h4>
<p>We tried to implement a context dependent <code>pat</code> matcher in <a href="https://github.com/rust-lang/rust/pull/78935">https://github.com/rust-lang/rust/pull/78935</a>, it didn't work out.<br>
I thought those experiments were the reason why <code>pat_(2015,2021)</code> were introduced in the first place, so I'm not sure why it's discussed again now.</p>



<a name="231518836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231518836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231518836">(Mar 23 2021 at 18:23)</a>:</h4>
<p>Although it is unfortunate that all the heuristics for the context dependent <code>pat</code> will end up in the compiler anyway due to the proposed migration lint.</p>



<a name="231519439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231519439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231519439">(Mar 23 2021 at 18:27)</a>:</h4>
<p>the compiler already checks what follows a fragment anyway, so that doesn't even require new code. it just needs to produce the migration lint there.</p>



<a name="231975033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231975033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231975033">(Mar 26 2021 at 14:36)</a>:</h4>
<p>I created a draft PR: <a href="https://github.com/rust-lang/rust/pull/83468">https://github.com/rust-lang/rust/pull/83468</a>, but it seems we need to add pat_atom instead of adding lint?</p>



<a name="231976089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/231976089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#231976089">(Mar 26 2021 at 14:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="232004809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232004809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232004809">(Mar 26 2021 at 17:34)</a>:</h4>
<p><span class="user-mention" data-user-id="296292">@Rustin Liu</span> let me take a look -- I think it's kind of orthogonal</p>



<a name="232063984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232063984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232063984">(Mar 27 2021 at 04:56)</a>:</h4>
<p>I don't know why <a href="https://github.com/rust-lang/rust/pull/83468#issuecomment-808651817">https://github.com/rust-lang/rust/pull/83468#issuecomment-808651817</a> is failing, can anyone help? Why does the allowed lint come up too?</p>



<a name="232073450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232073450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232073450">(Mar 27 2021 at 08:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="296292">Rustin Liu</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/232063984">said</a>:</p>
<blockquote>
<p>I don't know why <a href="https://github.com/rust-lang/rust/pull/83468#issuecomment-808651817">https://github.com/rust-lang/rust/pull/83468#issuecomment-808651817</a> is failing, can anyone help? Why does the allowed lint come up too?</p>
</blockquote>
<p>Fixed.</p>



<a name="232076352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232076352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232076352">(Mar 27 2021 at 09:02)</a>:</h4>
<p><span class="user-mention" data-user-id="296292">@Rustin Liu</span> the error is because the test is marked as "run-fail", and yet it does not panic at runtime</p>



<a name="232076366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232076366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232076366">(Mar 27 2021 at 09:02)</a>:</h4>
<p>I would suggest you add a <code>#![deny(or_patterns_back_compat)]</code> and then make the test <code>compile-fail</code></p>



<a name="232076369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232076369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232076369">(Mar 27 2021 at 09:02)</a>:</h4>
<p>(and run <code>--bless</code>)</p>



<a name="232076521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232076521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232076521">(Mar 27 2021 at 09:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/232076352">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="296292">Rustin Liu</span> the error is because the test is marked as "run-fail", and yet it does not panic at runtime</p>
</blockquote>
<p>Are you talking about the new error reporting? I'm talking about the old error.</p>



<a name="232080869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232080869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232080869">(Mar 27 2021 at 10:33)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/83468">https://github.com/rust-lang/rust/pull/83468</a> Ready for review. Could you please take a look? Also I would like to ask if I can request a code review at zulip? Will it bother you?</p>



<a name="232270404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232270404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232270404">(Mar 29 2021 at 13:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="296292">Rustin Liu</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/232080869">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/pull/83468">https://github.com/rust-lang/rust/pull/83468</a> Ready for review. Could you please take a look? Also I would like to ask if I can request a code review at zulip? Will it bother you?</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  Could you please take a look?</p>



<a name="232282784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232282784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232282784">(Mar 29 2021 at 15:03)</a>:</h4>
<p><span class="user-mention" data-user-id="296292">@Rustin Liu</span> I have no objection to being pinged on zulip :)</p>



<a name="232282798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232282798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232282798">(Mar 29 2021 at 15:03)</a>:</h4>
<p>will take a look!</p>



<a name="232410192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232410192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232410192">(Mar 30 2021 at 11:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm adding the corresponding auto-suggestion as you requested, but I don't know how to get only the span of the pattern in $pat:pat in that place, do you have any suggestions? Also is it appropriate to use <code>pat</code> for our span in this place? Because I think this is a problem only when <code>pat</code> and <code>|</code> come together.</p>



<a name="232453447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232453447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232453447">(Mar 30 2021 at 16:16)</a>:</h4>
<p><span class="user-mention" data-user-id="296292">@Rustin Liu</span> let me take a look :)</p>



<a name="232453591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232453591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232453591">(Mar 30 2021 at 16:17)</a>:</h4>
<p>I guess if you have <code>$foo:pat</code>, then span is the entire <code>$foo:pat</code>, right?</p>



<a name="232453862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232453862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232453862">(Mar 30 2021 at 16:19)</a>:</h4>
<p>one easy thing would be to construct a replacement using the name etc</p>



<a name="232453908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232453908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232453908">(Mar 30 2021 at 16:19)</a>:</h4>
<p>e.g., instead of replacing with "pat2015", replace with <code>$foo:pat2015</code></p>



<a name="232456390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232456390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232456390">(Mar 30 2021 at 16:34)</a>:</h4>
<p>there might be a "pretty print" option where you could construct a <code>TokenTree::MetaVarDecl(spa, ident, Some(Pat2015))</code> and pretty print it, but I can't figure out what that is based on some quick rip-grep'ing...</p>



<a name="232456586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232456586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232456586">(Mar 30 2021 at 16:36)</a>:</h4>
<p>there is <a href="https://github.com/rust-lang/rust/blob/9d7126b6def686536f77164356e1ed23cc94de24/compiler/rustc_expand/src/mbe/macro_rules.rs#L1160-L1172">this function</a></p>



<a name="232537257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232537257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232537257">(Mar 31 2021 at 05:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/232453908">said</a>:</p>
<blockquote>
<p>e.g., instead of replacing with "pat2015", replace with <code>$foo:pat2015</code></p>
</blockquote>
<p>I have solved the problem with your suggestion. Thanks for your reply. Also I have added more test cases.</p>



<a name="232627153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232627153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232627153">(Mar 31 2021 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="296292">@Rustin Liu</span> great!</p>



<a name="232832904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232832904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232832904">(Apr 01 2021 at 22:17)</a>:</h4>
<p>I want to kick off bikeshedding about what to call <code>pat2015</code> -- <a href="https://github.com/rust-lang/rust/pull/83386#issuecomment-812200554">see my write-up here</a>, <span class="user-mention" data-user-id="310399">@Mara</span> was arguing against <code>pat2015</code>/<code>pat2021</code> and I found the argument reasonably compelling (tl;dr, there is still a valid reason to use <code>pat2015</code>, shouldn't we give it a non-edition-based name, I think?)</p>



<a name="232834225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/232834225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#232834225">(Apr 01 2021 at 22:31)</a>:</h4>
<p>I just posted a comment there. I would propose that we keep the name <code>pat2015</code> for the purposes of edition migration, and if it turns out people also want it in current editions for other purposes, we can introduce an alias.</p>



<a name="234213086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/234213086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#234213086">(Apr 12 2021 at 19:06)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="296292">@Rustin Liu</span> -- I was curious if you would like to fix <a href="https://github.com/rust-lang/rust/issues/84138">https://github.com/rust-lang/rust/issues/84138</a> as follow-up to your PR</p>



<a name="234258736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/or%20patterns/near/234258736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hi-rustin <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/or.20patterns.html#234258736">(Apr 13 2021 at 02:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/213817-t-lang/topic/or.20patterns/near/234213086">said</a>:</p>
<blockquote>
<p>Hey <span class="user-mention silent" data-user-id="296292">Rustin Liu</span> -- I was curious if you would like to fix <a href="https://github.com/rust-lang/rust/issues/84138">https://github.com/rust-lang/rust/issues/84138</a> as follow-up to your PR</p>
</blockquote>
<p>I will fix it.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>